<template>
  <div>
  <div class="login">
    <el-form :model="catlogList" label-width="80px" class="login-box">
      <h3 class="login-title">分类添加</h3>
    
      <el-form-item label="分类编号" prop="catelogCode">
        <el-input type="text" placeholder="请输入分类目录编号" v-model="catlogList.catelogCode" />
      </el-form-item>

   

      <el-form-item label="分类名" prop="catelogName">
        <el-input type="text" placeholder="请输入分类目录名" v-model="catlogList.catelogName" />
      </el-form-item>
     


      <el-form-item>
        <el-button type="primary" @click="catlogAdd()">添加</el-button>
        <router-link to="/admin/manageProductCatlog"> <el-button type="primary" >返回</el-button></router-link>
      </el-form-item>
    </el-form>
</div>

</div>
  
</template>

<script>
export default {
  name:"CatlogAdd",
  data(){
    return{
      	search:'',
        catlogList:{
          
      
          catelogCode:'',
          catelogName:'',

          admin:''
        }
    }
  },methods:{
      catlogAdd:function(){
        var admin=localStorage.getItem("admin");
        this.catlogList.admin=admin;
        this.$axios.get("/catlog/addCatlogs",{params:this.catlogList}).then(
          res=>{
              this.$router.push({path:"/admin/manageProductCatlog",params:alert("添加成功")})
          }
        )
      }
  }
}
</script>

<style>
.login-box {
  border: 1px solid #DCDFE6;
  width: 600px;
  margin: 180px auto;
  padding: 35px 35px 15px 35px;
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  box-shadow: 0 0 25px #909399;
  position: absolute;
  top:-175px;
  left: 3px;
 
 
}

.login {
  max-width:600px;
  margin: 60px auto;
  background: #fff;
  padding: 20px 40px;
  border-radius: 10px;
  position: relative;
  z-index: 9;
 
}


</style>